<template>
  <div id="note_box" class="invoice-note-box">
    <div class="invoice-note">
      <div class="note-header">
        <div class="title-box">
          <div class="title" v-if="obj.config.invoice.title">发货单标题</div>
          <div class="time" v-if="obj.config.invoice.create_time">2021-03-23 13:08:07</div>
        </div>
        <div class="logo" v-if="obj.logo">
          <img :src="obj.logo" >
         </div>
        <div class="bar-code">
          <div class="code-image"><img src="@/assets/images/tiaoxm.png" alt="" /></div>

          <div class="code" v-if="obj.config.invoice.invoice_no">2021032313080756848</div>
        </div>
      </div>
      <div class="note-content">
        <ul>
          <li>
            <div class="item-title">订单信息</div>
            <div class="item-info-box order-info">
              <ul>
                <li v-if="obj.config.order.order_no">
                  <span class="label">订单编号：</span>
                  <span class="content">16164621122551964753753389</span>
                </li>
                <li>
                  <span class="label">用户昵称：</span>
                  <span class="content">xx网络科技</span>
                </li>
                <li v-if="obj.config.order.pay_type">
                  <span class="label">支付方式：</span>
                  <span class="content">微信</span>
                </li>
                <li v-if="obj.config.order.create_time">
                  <span class="label">下单时间：</span>
                  <span class="content">2021-03-23 09:15:12</span>
                </li>
                <li v-if="obj.config.order.pay_time">
                  <span class="label">付款时间：</span>
                  <span class="content"></span>
                </li>
                <li>
                  <span class="label">配送方式：</span>
                  <span class="content">快递</span>
                </li>
              </ul>
            </div>
          </li>
          <li>
            <div class="item-title">收货人信息</div>
            <div class="item-info-box user-info action">
              <ul>
                <li v-if="obj.config.receiving.user_name" class="name">
                  <span class="label">收货人姓名：</span>
                  <span class="content">11</span>
                </li>
                <li v-if="obj.config.receiving.mobile" class="contact-way">
                  <span class="label">联系方式：</span>
                  <span class="content">15111111111</span>
                </li>
                <li v-if="obj.config.receiving.address" class="address">
                  <span class="label">收货人地址：</span>
                  <span class="content">北京市市辖区东城区</span>
                </li>
              </ul>
              <div v-if="obj.config.receiving.info" class="leave-message">
                <span class="label">买家留言：</span>
                <span class="content"></span>
              </div>
            </div>
          </li>
          <li>
            <div class="item-title">商品信息</div>
            <div class="shop-table-list">
              <table width="100%">
                <thead class="table-header">
                  <tr>
                    <th v-if="obj.config.goods.serial" class="number">序号</th>
                    <th v-if="obj.config.goods.name" class="title">商品名称</th>
                    <th class="goods_code">商品编码</th>
                    <th v-if="obj.config.goods.aftr" class="option_title">规格</th>
                    <th class="price_unit">单价</th>
                    <th v-if="obj.config.goods.number" class="total">数量</th>
                    <th v-if="obj.config.goods.amount" class="price">总价</th>
                  </tr>
                </thead>
                <tbody class="table-content">
                  <tr>
                    <td v-if="obj.config.goods.serial" class="number">
                      <div><div class="">1</div></div>
                    </td>
                    <td v-if="obj.config.goods.name" class="title">
                      <div><div class="goods-two-line-hide">福建红香蕉</div></div>
                    </td>
                    <td class="goods_code">
                      <div><div class="">1234567899625566</div></div>
                    </td>
                    <td v-if="obj.config.goods.aftr" class="option_title">
                      <div><div class="goods-two-line-hide">颜色:红色,尺码:M</div></div>
                    </td>
                    <td class="price_unit">
                      <div><div class="">￥9.90</div></div>
                    </td>
                    <td v-if="obj.config.goods.number" class="total">
                      <div><div class="">1</div></div>
                    </td>
                    <td v-if="obj.config.goods.amount" class="price">
                      <div><div class="">￥9.90</div></div>
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </li>
          <li>
            <div class="item-title">费用信息</div>
            <div class="item-info-box recharge-info-box">
              <ul class="recharge-info">
                <li class="goods-total-li" v-if="obj.config.fee.number"><div class="goods-total">商品件数合计：1</div></li>
                <li>
                  <ul>
                    <li v-if="obj.config.fee.freight">
                      <div class="label">订单运费：</div>
                      <div class="content">¥6.00</div>
                    </li>
                    <li v-if="obj.config.fee.subtotal">
                      <div class="label">商品小计：</div>
                      <div class="content">¥109.90</div>
                    </li>
                    <li>
                      <div class="label" v-if="obj.config.fee.discount">订单优惠：</div>
                      <div class="content">-¥0</div>
                    </li>
                    <li class="payment" v-if="obj.config.fee.amount">
                      <div class="label">实付金额：</div>
                      <div class="content">
                        <span style="font-size: 14px;">¥</span>
                        109.9
                      </div>
                    </li>
                  </ul>
                </li>
              </ul>
            </div>
          </li>
        </ul>
      </div>
 <!--     <div class="note-footer">
        <div class="qr-code">
          <div class="banner_qr_code">
            <div class="banner"><canvas class="qrcode" height="60" width="60"></canvas></div>
          </div>
        </div>

      </div> -->
      <div class="note-footer">
        <div class="qr-code">
          <vue-qr v-if="obj.config.qrcode.content" :text="obj.config.qrcode.content" :size="200"></vue-qr>

        </div>
        <div v-if="obj.config.qrcode.bottom" class="name">{{obj.config.qrcode.bottom}}</div>
      </div>
    </div>
  </div>
</template>

<script>
  import vueQr from 'vue-qr';

export default {
  props: {
    obj: {
      type: Object,
      default: function() {
        return {};
      }
    }
  },
  components:{
    vueQr
  }
};
</script>

<style scoped>
.invoice-note-box {
  -ms-flex-negative: 0;
  flex-shrink: 0;
  width: 842px;
  margin-right: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #ffffff;
}

.invoice-note {
  background-color: #ffffff;
  padding: 30px 20px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  min-height: 100%;
}

.invoice-note .note-header {
  position: relative;
  color: #262b30;
  min-height: 56px;
}

.invoice-note .note-header .title-box {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  min-height: 62px;
}

.invoice-note .note-header .title-box .title {
  font-size: 28px;
  font-weight: 600;
  line-height: 39px;
  text-align: center;
}

.invoice-note .note-header .title-box .time {
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.invoice-note .note-header .logo {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 100%;
  height: 58px;
}

.invoice-note .note-header .logo > img {
  max-width: 100%;
  max-height: 100%;
}

.invoice-note .note-header .bar-code {
  position: absolute;
  right: 0;
  top: 0;
}

.invoice-note .note-header .bar-code .code-image {
  height: 42px;
  overflow: hidden;
}

.invoice-note .note-header .bar-code .code-image > img {
  max-width: 100%;
  max-height: 100%;
}

.invoice-note .note-header .bar-code .code {
  font-size: 14px;
  line-height: 20px;
  text-align: right;
}

.invoice-note .note-content > ul > li .item-title {
  font-size: 16px;
  line-height: 22px;
  color: #262b30;
  padding-top: 20px;
  font-weight: bold;
  padding-bottom: 10px;
}

.invoice-note .note-content > ul > li .item-info-box {
  border: 1px solid #636669;
  padding: 12px 12px 6px 12px;
  font-size: 14px;
  line-height: 20px;
}

.invoice-note .note-content > ul > li .item-info-box.order-info > ul > li {
  width: 240px;
  margin-right: 20px;
}

.invoice-note .note-content > ul > li .item-info-box.order-info > ul > li:nth-child(3n + 1) {
  width: 250px;
}

.invoice-note .note-content > ul > li .item-info-box.order-info > ul > li:nth-child(3n) {
  margin-right: 0;
}

.invoice-note .note-content > ul > li .item-info-box.user-info {
  padding: 12px 0 6px 0;
}

.invoice-note .note-content > ul > li .item-info-box.user-info > ul {
  padding-left: 12px;
}

.invoice-note .note-content > ul > li .item-info-box.user-info > ul > li {
  font-size: 12px;
  line-height: 20px;
  width: 240px;
}

.invoice-note .note-content > ul > li .item-info-box.user-info > ul > li.name,
.invoice-note .note-content > ul > li .item-info-box.user-info > ul > li.contact-way {
  margin-right: 20px;
}

.invoice-note .note-content > ul > li .item-info-box.user-info > ul > li:first-child.name {
  width: 250px;
}

.invoice-note .note-content > ul > li .item-info-box.user-info > ul > li:first-child.contact-way {
  width: 250px;
}

.invoice-note .note-content > ul > li .item-info-box.user-info .leave-message {
  width: 100%;
  padding: 12px 12px 6px 12px;
  margin-top: 6px;
  border-top: 1px solid #636669;
  box-sizing: border-box;
}

.invoice-note .note-content > ul > li .item-info-box > ul {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

.invoice-note .note-content > ul > li .order-info > ul {
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}

.invoice-note .note-content > ul > li .item-info-box > ul > li {
  font-size: 12px;
  line-height: 20px;
  color: #262b30;
  padding-bottom: 6px;
}

.invoice-note .note-content > ul > li .item-info-box > ul > li.address {
  width: 100%;
}

.invoice-note .note-content > ul > li .item-info-box.recharge-info-box {
  padding: 0;
}

.invoice-note .note-content > ul > li .item-info-box.recharge-info-box .recharge-info {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: stretch;
  -ms-flex-align: stretch;
  align-items: stretch;
  -webkit-box-pack: end;
  -ms-flex-pack: end;
  justify-content: flex-end;
}

.invoice-note .note-content > ul > li .item-info-box.recharge-info-box .recharge-info > li {
  display: table-cell;
  padding-bottom: 0;
}

.invoice-note .note-content > ul > li .item-info-box.recharge-info-box .recharge-info > li:first-child {
  font-size: 18px;
  line-height: 25px;
  width: 40%;
  text-align: center;
}

.invoice-note .note-content > ul > li .item-info-box.recharge-info-box .recharge-info > li:last-child {
  width: 60%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: end;
  -ms-flex-pack: end;
  justify-content: flex-end;
}

.invoice-note .note-content > ul > li .item-info-box.recharge-info-box .recharge-info > li.goods-total-li {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  border-right: 1px solid #636669;
}

.invoice-note .note-content > ul > li .item-info-box.recharge-info-box .recharge-info > li > ul {
  padding: 12px 12px 6px 12px;
}

.invoice-note .note-content > ul > li .item-info-box.recharge-info-box .recharge-info > li > ul > li {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  font-size: 14px;
  line-height: 20px;
  padding-bottom: 6px;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

.invoice-note .note-content > ul > li .item-info-box.recharge-info-box .recharge-info > li > ul > li .label {
  text-align: right;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

.invoice-note .note-content > ul > li .item-info-box.recharge-info-box .recharge-info > li > ul > li .content {
  min-width: 80px;
}

.invoice-note .note-content > ul > li .item-info-box.recharge-info-box .recharge-info > li > ul > li.payment {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.invoice-note .note-content > ul > li .item-info-box.recharge-info-box .recharge-info > li > ul > li.payment .label {
  font-size: 14px;
  line-height: 20px;
  vertical-align: middle;
}

.invoice-note .note-content > ul > li .item-info-box.recharge-info-box .recharge-info > li > ul > li.payment .content {
  font-size: 20px;
  line-height: 28px;
  font-weight: bold;
}

.invoice-note .note-content > ul > li .shop-table-list {
  border: 1px solid #636669;
}

.invoice-note .note-content > ul > li .shop-table-list thead {
  width: 100%;
}

.invoice-note .note-content > ul > li .shop-table-list table {
  border-collapse: collapse;
}

.invoice-note .note-content > ul > li .shop-table-list table tr th,
.invoice-note .note-content > ul > li .shop-table-list table tr td > div {
  padding: 10px 20px 10px 0;
  text-align: left;
  font-size: 14px;
  line-height: 20px;
}

.invoice-note .note-content > ul > li .shop-table-list table tr td > div {
  padding: 4px 20px 4px 0;
}

.invoice-note .note-content > ul > li .shop-table-list table tr th:first-child,
.invoice-note .note-content > ul > li .shop-table-list table tr td:first-child {
  padding-left: 12px;
}

.invoice-note .note-content > ul > li .shop-table-list table tr th:last-child > div,
.invoice-note .note-content > ul > li .shop-table-list table tr td:last-child > div {
  padding-right: 12px;
}

.invoice-note .note-content > ul > li .shop-table-list table tr th {
  font-weight: bold;
}

.invoice-note .note-content > ul > li .shop-table-list table tr th.number {
  padding-right: 12px;
}

.invoice-note .note-content > ul > li .shop-table-list table tr td {
  border-top: 1px solid #636669;
}

.invoice-note .note-content > ul > li .shop-table-list table tr .number {
  width: 55px;
}

.invoice-note .note-content > ul > li .shop-table-list table tr .title {
  min-width: 100px;
}

.invoice-note .note-content > ul > li .shop-table-list table tr .title .goods-two-line-hide {
  max-height: 40px;
}

.invoice-note .note-content > ul > li .shop-table-list table tr .short_title {
  min-width: 80px;
}

.invoice-note .note-content > ul > li .shop-table-list table tr .goods_code {
  min-width: 80px;
}

.invoice-note .note-content > ul > li .shop-table-list table tr .option_title {
  min-width: 100px;
}

.invoice-note .note-content > ul > li .shop-table-list table tr .option_title .goods-two-line-hide {
  max-height: 40px;
}

.invoice-note .note-content > ul > li .shop-table-list table tr .price_unit {
  min-width: 60px;
}

.invoice-note .note-content > ul > li .shop-table-list table tr .total {
  min-width: 50px;
}

.invoice-note .note-content > ul > li .shop-table-list table tr .price {
  min-width: 60px;
}

.invoice-note .note-footer {
  padding-top: 70px;
  margin: 0 auto;
}

.invoice-note .note-footer .qr-code {
  width: 124px;
  height: 124px;
  overflow: hidden;
  margin: 0 auto;
}

.invoice-note .note-footer .qr-code > img {
  width: 100%;
  height: 100%;
}

.invoice-note .note-footer .name {
  font-size: 14px;
  line-height: 20px;
  color: #262b30;
  text-align: center;
  padding-top: 6px;
}

.invoice-note .note-header-no-long {
  padding-bottom: 40px;
}

.invoice-note .note-content-no-long > ul > li:last-child {
  border-bottom: 1px solid #636669;
}

.invoice-note .note-content-no-long > ul > li .item-info-box {
  border-bottom: none;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.user-info {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  padding: 0;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.user-info > ul,
.invoice-note .note-content-no-long > ul > li .item-info-box.user-info .leave-message {
  padding: 12px 12px 6px 12px;
  margin-top: 0;
  border-top: none;
  border-left: 1px solid #636669;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.user-info > ul {
  width: 70%;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.user-info > ul > li {
  width: 36.3%;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.user-info > ul > li.address {
  width: 100%;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.user-info .leave-message {
  width: 30%;
  padding-bottom: 18px;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.recharge-info-box .recharge-info-no-long {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: stretch;
  -ms-flex-align: stretch;
  align-items: stretch;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.recharge-info-box .recharge-info-no-long .goods-number {
  border-right: 1px solid #636669;
  text-align: center;
  font-size: 18px;
  line-height: 25px;
  width: 25%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.recharge-info-box .recharge-info-no-long .goods-number > div {
  text-align: center;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.recharge-info-box .recharge-info-no-long > li {
  padding: 12px 12px 12px 12px;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.recharge-info-box .recharge-info-no-long > li.payment {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: end;
  -ms-flex-pack: end;
  justify-content: flex-end;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.recharge-info-box .recharge-info-no-long > li.payment .left {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.recharge-info-box .recharge-info-no-long > li.payment .left .left-item {
  padding-right: 20px;
  font-size: 14px;
  line-height: 20px;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.recharge-info-box .recharge-info-no-long > li.payment .right .label {
  font-size: 14px;
  line-height: 20px;
}

.invoice-note .note-content-no-long > ul > li .item-info-box.recharge-info-box .recharge-info-no-long > li.payment .right .content {
  font-size: 20px;
  line-height: 28px;
  font-weight: bold;
}

.invoice-note .note-content-no-long > ul > li .shop-table-list {
  border-bottom: none;
}

.invoice-note .note-footer-no-long {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding-top: 10px;
}

.invoice-note .note-footer-no-long .qr-code {
  width: 60px;
  height: 60px;
  margin: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

.invoice-note .note-footer-no-long .name {
  padding-top: 0;
  padding-left: 6px;
  font-size: 12px;
  line-height: 17px;
  text-align: left;
}

.goods-two-line-hide {
  word-break: break-all;
  overflow: hidden;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
</style>
